﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using SalesModel;

namespace SalesController.ClassesDB
{
    [Serializable]
    public class PriceByDateDB
    {
        DAOFactory daoFactory = null;
        DAOPriceByDate daoPriceByDate = null;
        public PriceByDateDB()
        {
            daoFactory = DAOFactory.getDAOFactory(DBConnection.dbType);
            daoPriceByDate = daoFactory.getDAOPriceByDate();
        }
        public List<PriceByDate> Values
        {
            get
            {
                return daoPriceByDate.queryAll();
            }
        }
        public void Add(PriceByDate pd)
        {
            daoPriceByDate.add(pd);
        }
        public int Size()
        {
            return daoPriceByDate.count();
        }
        public void Delete(int i)
        {
            daoPriceByDate.delete(i);
        }
        public void Update(PriceByDate pd)
        {
            daoPriceByDate.update(pd);
        }
        public PriceByDate QueryById(int id)
        {
            return daoPriceByDate.queryByIdProduct(id);
        }
    }
}
